#include <bits/stdc++.h>
using namespace std;
#define int long long
int n, m, dfn[100001], low[100001], flag[100001], idx;
vector<int> edge[100001], childs[100001];

int tarjan(int u, int fa)
{
    dfn[u] = low[u] = ++idx;
    int child = 0, c = 0;
    for (int x : edge[u]) {
        if (!dfn[x]) {
            int op = tarjan(x, u);
            c += op;
            low[u] = min(low[u], low[x]);
            if (low[x] >= dfn[u])
                flag[u] = true, child += op, childs[u].push_back(op);
        } else if (x != fa)
            low[u] = min(low[u], dfn[x]);
    }
    if (fa == u && child >= 2)
        flag[u] = true;
    childs[u].push_back(n - child - 1);
    return c + 1;
}

signed main()
{
    cin >> n >> m;
    for (int i = 1; i <= m; i++) {
        int x, y;
        cin >> x >> y;
        edge[x].push_back(y);
        edge[y].push_back(x);
    }
    for (int i = 1; i <= n; i++)
        if (!dfn[i])
            idx = 0, tarjan(i, i);
    for (int i = 1; i <= n; i++) {
        if (!flag[i]) {
            cout << n * 2 - 2 << endl;
            continue;
        }
        int ans = n * 2 - 2;
        int sum_of_sizes = 0;
        for (int sz : childs[i]) {
            sum_of_sizes += sz;
        }

        int sum_of_prod = 0;
        for (int sz : childs[i]) {
            sum_of_prod += sz * (sum_of_sizes - sz);
        }
        ans += sum_of_prod;
        cout << ans << "\n";
    }
    return 0;
}